package com.ruoyi.project.query.paeaDsCusv.controller;

import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.project.query.paeaDsLink.domain.DsCustAccLink;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.project.query.paeaDsCusv.domain.PaeaDsCusv;
import com.ruoyi.project.query.paeaDsCusv.service.IPaeaDsCusvService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;

import com.ruoyi.framework.web.page.TableDataInfo;

/**
 * 客户Controller
 *
 * @author gang.wei
 * @date 2020-04-06
 */
@Controller
@RequestMapping("/query/paeaDsCusv")
public class PaeaDsCusvController extends BaseController
{
    private String prefix = "query/paeaDsCusv";

    @Autowired
    private IPaeaDsCusvService paeaDsCusvService;

    @RequiresPermissions("query:paeaDsCusv:view")
    @GetMapping()
    public String dsCusv()
    {
        return prefix + "/paeaDsCusv";
    }

    /**
     * 查询客户列表
     */
    @RequiresPermissions("query:paeaDsCusv:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(PaeaDsCusv paeaDsCusv)
    {
        return getDataTable(new ArrayList<DsCustAccLink>());
    }
    /**
     * 查询客户列表
     */
    @RequiresPermissions("query:paeaDsCusv:queryDsCustAccLink")
    @PostMapping("/queryDsCustAccLink")
    @ResponseBody
    public TableDataInfo queryDsCustAccLink(DsCustAccLink  dsCustAccLink)
    {
        startPage();
        List<DsCustAccLink> list = paeaDsCusvService.queryDsCustAccLink(dsCustAccLink);
        return getDataTable(list);
    }
    /**
     * 导出客户列表
     */
    @RequiresPermissions("query:paeaDsCusv:export")
    @PostMapping("/export")
    @ResponseBody
    public AjaxResult export(PaeaDsCusv paeaDsCusv)
    {
        List<PaeaDsCusv> list = paeaDsCusvService.list(new QueryWrapper<>(paeaDsCusv));
        ExcelUtil<PaeaDsCusv> util = new ExcelUtil<PaeaDsCusv>(PaeaDsCusv.class);
        return util.exportExcel(list, "paeaDsCusv");
    }

}
